Added test, re-factored models