removing global js vars in favor of vars in the client object