Split into separate files
Update example
Better document `when` API