fix style and add basic validations