added configurability
 - refactored to provider