Creating abstract class to refactor some code repetition