restructured the files with more modular design, updating validation