Add common behavior to some functions