Fully refactoring code base