How can I improve this class?