Code quality and performance improvement