minor code cleanup
clean up some code in the serialiser