improve spec parser