rework some logic