Refactoring parse()