Switch to saving object id instead of object in all table