code clean up
implement partition using type-level list.