Expand the feature-set and refactor

Some code duplication can surely be avoided via an abstraction layer.