change javascript objects hierarchy.