Refactor compile steps