Small improvements in code