first stage of panel write refactoring