moved loop class to own file