fixed issue with home page
added user registration
deduplicated code as template inheritance