After reviewing this code could be simpler, made it so