Make it work, make it right, make it fast, in that order

Make it right is the refactoring