Addressed code review comments for JS