Added validations and tests