Start to extract variables and remove useless things