Refactor dynamic funcalls