Changed class-file structure, rearranged messy code, used LINQ