Code re-arrangement