rewrite generation declaration
make functions as const referances