Adding tags/associations and some refactoring