Improve syntax based on JSHint recommendations