fixes #19 slight refactor of the previous checkin to allow base class to handle shared logic