Adding a prerequisite class for rails and refactoring