Abstracted out the functionality