Major refactoring.
New utility class.