Code cleanup and refactor mapping information to new module.