partial re-implementation