Added validations for Entry constructor and improved code readability.