Adds filter by pattern to the interface terminals

Some code cleanup