structure associations and views properly