Moved duplicate code to base class