Refactoring parser to use strategy pattern.