Code cleanup on maps