Rearranged and renamed for readability and reusability, really
Renamed and rearranged for readability, really.