use callbacks or static invocation and clean up a bit, refs #1256