simplified logic and naming