Refactored for COS build process