complete code refactoring