(#14) - adds rewrites support