Code formatting and cleaning