refactoring and improves