Refactoring code - reusing format code via base class