Merge "Unified layer capture functions into one function"