massive refactoring, still todo: stubgenerator
current state, improving stub generator