Function process in admin.sh + some improvements