Begin refactoring (code cleanup)