some changes to rails 4 syntax