Improve mapping and clean up