Refactoring stub generation in order to prepare for new harness gen approach