Added comments, changed register func in views, handle_msg