Code cleanup, formatting changes