various improvements
hand merge