minor moving code around