Removed useless tests, simplified validations.
Code style.