refactored to use cluster module. callback pyramids getting a little out of hand