Refactored to make easy to use