added authorization code.  Cleaned up models