Implemented some code improvements that were suggested in review