re-factored with function