Refactor for api consistency