Move empty/mapping check to connection