fixed loginfilter and refactored model