Added if block generation (without condition for a while)
Added loop generation
Implemented function block generation.
Models usage replaced with repo one