move parser creation from global scope