some code moves mainly