Improvin with flow with abstract class