Small refactor changes, and change to avoid function conflicts