reorganized parsing into multiple files