why is this class so big and complicated?