squashing lots of changes together to clean up commit history, includes callbacks and bet fixes