Use a single build step and remove temporary dependencies to flatten layers