Refactor parser, implement options