Tidying data source code
Move filter code into separate class