soapbox soapbox3
  appstore   macstore

how to best optimize this code with a subroutine?