More code cleanup and refactoring. Removed a utility class for measuring time since it was not being used.