relocating some code