misc cleanup

removing redundant exceptions, semicolons, simplifying expressions etc.