simplify and correct parameters and use of optionals