clean up gun code