moved a couple functions to private