some refactoring, added some GUI Tests