Reorganize the code, add mappings