epic refactoring! API changed, tests updated