consistent way to define computed values by function