modulated all relevant functions into separate namespaced file