Added tags and refactoring