further mini refactorings to please code climate