mostly clean-up, logging
updated support for taking the Cookie type as a parameter