Reducing complexity by relocating code