Clean up HTML source formatting.  Pull out logic from view into User model