webaccess: reorganized code