complete parse logic