Code Refactorings
Adapted Code for Rails4
Added basic spec set