Some refactoring and adding superclass for abstract logging / dispatching