utils / web: some minor cleanupand optimizations