restructure controller