test cases and temporary resources removal improvements