added optional parameters support