Refactoring for better optional  support of prefixes.