abstracted away some functions