Cleaned up agent code and added filter for avoiding certain classes.