Some refartoring to prepare for the bigger changes
Further refactoring and first wpf extensions