some code smells and how to refactor them