cleanup, rearrange
revert for 18mode