using abstract class and methods