refactoring spec rake tasks