First attempt at generic parser