Improving case classes use