Merged and refactored all common code into _Utils files.