Refactor home & application controler