cleaning up slave logic