move invokeInAwtEventQueue to common helper