Fixed filters with improved flexibility and refactored
url parsing code to remove code duplication and simplify