cleaned up js variable assignment