Unused code removal, more logging points, spacing cleanup