Initial JS Refactor: looks like this was left out??