reorged files and filled out rails helpers