End of rules implementation