Better use of derived classes