tools: make functions for common file creation