added globals for client side, env variables for templates