Changed to use separation of concerns