General code improvement