Refactored to abstract class