refactored injection of current environment for better testing capabilities of server and client code
fixing lint messages