Some more refactoring. Programm compiles now.