implemented calloc special treatment
small refactorings