Usage function and code cleaning