abstracted out some boilerplate