Refactored back to js.