remove some unnecessary code and update main.lua