file structure and some code changes