Refactoring, removing inline functions to autoHelpers.R