More code refinements