refactors code smells