Refactoring computed function call