Applying p-layer in SRAM saves 4 more bytes. Unfortunately this one procedure now uses SREG 3 times to transfer control flow, making it a bit hard to follow.