move rabbit class to lib