formatting and other cleanup