Make loop interval configurable