separated model and algorithm