Some Refactorings

hey phil,

please see attached some refactorings. would be nice if you would merge them

cheers, cyrill