cleaned up associate code a bit