Code cleanup (rebracing, extending)