Had a typo, added required fields, completed unittests for basic use cases.
Refactored for readability.