refactor rjs define