moved parsing to sep. function