refactored paramater handling