Additional refactoring to better deal with prefixes