update

Moved 2 re-useable functions to helper file.