Tidied up code, created singletons instead of using AMGlobalObjects class