refactor validation
fix / improve some tests