chain changes, cleanup and fix style