split some stuff off to make it more modular.