code formatting and string cleanup