some refactory on abstractsortdemo and demo classes