Extracted out an object for apply filters
flattened structure, made functional
extracted out the placeholder finding logic
ordered logic a bit else to show why nil is tested
Moved filter to file of its own
Simplified writer
Added spec for filter
Added filtering to hash and array writer