use factories instead of controllers