Do code refactoring