refactor ipCore js