Refactor home module controller