Separated most functionality, added change entities.