move logic from capture & test to app