Moved tags code to plugin