refactoring to improve