Added some globals in model to clean up code