Rework some logic to improve readability