refactor of core classes