Fixed passing of localized parameters (incorrect encoding) + refactoring