Remove unnecessary $s and as-patterns