move crs constructor outside loop