simplifying the code of some classes