Separate parsing function