Removed all global variables and added as a service, also added methods to utilities class to reduce boilerplate code