introduced primary entities and rearranged loading order taking dependencies into account