Refactor to make function names more consistent