Filter to config and other good refactorings