Main capture functionality