Refactoring: Moved tag processing functions to a separated file.