designing classes so that they there is no repetition