Refactor code to looks like all other code in this JS module