cleanup and add documentation (`@param`)