Refactored the code to allow a better handling of the prefix parameters.