Needs integration tests!