Refactor: extracting common methods to a base class