some changes and refactoring to be able to reset the prefix in the prefix model