Code review changes: consistent length determination and remove filter