depends on decorated >= 1.5.0
refactor using wrapper function