Reorganise code. Remove redundant paths. Add ability to specify an attribute instead of a custom tag name.