Removed debug code; Refactored regexp