refactor core class