Refactor for independent use