partially use function and memorize function returning values