refactored to split modules renamed to match upstream docs slight improvement to slave error handling