day filtering added + some refactoring