split compilation steps into 2 steps