refactor implementation of the localization prelude