Refactored case classes val names. Added some logging