remove associations and segment out code