factored some stuff out