cleanup and remove copy/paste code