re-organize code tree