Create better structure and error fixing in several files.