validation changes and structuring

change validation handling and file structure