Five Lines of Code : How and when to refactor