-- minor improvements on proper resource free-up