Merged the two shared calls into one function.