Refactor the return values of core functions