Reorganize the code + add group access