Moved duplicate code into abstract class