consolidate methods used for parsing into a function script