Rework to pull from functions and avoid duping