ROOMS-333: Move rules related hooks to specific files
ROOMS-333: Bugfixes and improvements