Split code off into base class