refactored core classes