Split main into parts.