Moved parsing into a separate class.