Code quality improvements after review