Coding style cleanups & some duplication removal