Removed old write file method

linked with @83e27544f5aa018242394e96fbae776c3da64964