Refactor for better specs