Mover result function out of array