some refactoring using abstracts