wip-153: Added support for TTL and timestamp in the writer

There's quite a lot of repetitive code here. Can we somehow extract common parts to a separate method or two methods? It looks like you're changing just one parameter per all TTL methods and one per all timestamp methods.