Clean up mapper configuration

Use templates in mapper etc. instead of overloaded methods
Various clean up