Pulled controller interface out and a generalized loop function