Reshaped the application to use only one global object