refactoring and making code better