designed api. before/after hook should be fixed.