clean up brackets, remove dead code