refactoring laws_helper.rb