Added message filtering and improved file reading performance