refactor example controller