fix regex and cleanup un-needed variables in curl init