moved some functions from "basic.js" to "utils.js"