Refactor #3942: Refactor singleton Class to javascript object