create attachment factory & implement its tests