add rules class implementation