Refactor in classes and new functionality to Associations