refactoring parseinst.js