factored out all external deps