passing tests, but API is clunky