change file structure and add tests