Migrate into separate files, remove locale dependency