re-factored tests