Re-organizing code, 2 nested class (Master/Slave).