Basic refactoring and Tom's recommendations