some refactoring to allow for nicer usage in deriving classes