[IMP] various code improvements

mostly styling, and related micro-changes