move functions out of bootstrap and into more appropriate locations