rpec refactor