moved functions to fit rails best practices --> skinny controllers, fat models