Refactor New() function to take a map for config