Refactor callback setup to use lambda instead of eval

Replace the use of an evaluated string literal with a lamba.