why not write a method to do this work?

not sure if you are being told how to do something, but inheritance will handle most of your situations for you

write the methods you need in every...