add clear cache ability and clean up code