renamed and moved a function