wip: issue grants working. TODO: check different use cases
wip
move model to separate file