refactoring code base