smart functions