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