chore(core): refactor code