moved shared functions