Improve compilation by segmenting it in steps