moved function to correct class