Direct z-function approach and renormalization of one-loop stress tensor in curved spacetimes