use extra function instead of abstract class