compacting code in create.js