refactor to inline root panel