refactored some code and improved list compatibility of tags