Fixed missing code refactoring