[WIP] use Rule instead of mapping everywhere