Continued work on associations; refactoring