Refactor: removed duplicated mkdir of CA_PATH and make sure directory exists before trying to remove files from it.