Abstracted some types to allow a little bit of reuse