Refactor boilerplate functionality into base class