starts to use factories instead of data from controllers