Change of file structure, added classes and functions