changed inheritance pattern to satisfy liskov substitution principle