code format and delete unused