re-factored structure