move drawing context to own module