Refactoring of utilities so I can use from map tool and for better clarity.. All tests passing.