refactor to reduce repitition