refactoring core classes