refactor rpec