moved function to static