Cleaned up using lookup helper and cleaned up the logic