Move include parsing logic to separate file