fix parsing and change interface a bit