refactor tag a bit, need to work on handling signatures