refactoring parsing code into separate converter