cleanups, tab fixes, remove redundant code