unify backend and frontend in staging.pp