[Refactor] Major refactoring (JSHint)