remove empty spaces, change order to have belongs_to statements consecutive