Cleaned up the code by eslint standards