export view code for operation (I really need to get some tests around this thing...)