Create Lib and implement sample, need maybe again create a abstract preference, fix #2 and fix #3