Move high level capture code to separate files