refactor core classes