Move SmartFile into separate file