Rework to remove the hackiness