refactor and instruction creation