make parameters more flexible to change and the code structure simpler