common.js for ECS