Broke out functions to separate file