Moved controller loops to helper