Changed file structure and some other refactorings.