Simplified file naming code.