remove unused code
split compile into compile.middle and compile.back