Design of the pion extraction and focusing systems