improving partition api