added validations, tried to implement helpers