Replaced global settings with parameters