moved some files
improved validation
move internal class to end of file