refactor to 0.6 middleware load