refactored function call to constructor setting