coding style and move middleware