minor refactoring
simplification
save/restore offset+scale
rotation
refactoring
fixes