add some structs and functions from rule creating