Reorganizes code tree