file creation delayed and builStatement functionality refactored