move code into parent abstract class