refactored parameters passing