added a utility file to reduce repeat functions