remove apiConfig & reformat code