openssd: refactor ap initialization