remove unused code
cleanup
cleanup
fold in writeOperandInternal