adapted code to changed column names, added FactoryGirl, refactored some stuff