moved common functions into new file