baz ham refactor