simplify loop.go