Abstracting out some logic as well as adding more comments