Moved filter to file of its own
Simplified writer
Added spec for filter