refactor skill.js