Modularized mapSDocument do make it easier maintainable.