Cleaned up JS after code review