Refactor associations class to use params hash