Rewrite the code for validating reddit links