Cleaning up formatting and validation.