extract runnable to inner class