nitvm: clean the code and add some comments