formatting and cleanup for task