Added nested runnable class to reduce lines