re-factored core classes