add factory and sort