fixed associations and some factories