fix AT and remove unused code