More cleanup, added filter for expiring devices