Moved association functionality to separate template