Simplified environment variables setup
Tidied up the lisp code