moved and renamed functions