Avoid duplications of the same method on two classes