Remove regex & fix looping