move option parse to own method