some changes/rework