re-factored some stuff