clean up whitespace, optional params