Tightened up logic