Refactor for distribution