move type filtering to own function
minor renames