Changed helper logic to be more intuitive