refactoring for mapUtil and fixing error pages