Feature/master/pup 1372 enhance defined function