refactored a bit of code to make it more readable. stuck on a scoping/timing issue with bacon. something about the value not being returned or set in time