Cleaned up the code a bit

before publishing to NPM
cleaned up code