Improving the quality of nearly-zero energy buildings