Partly migrated pop3 to Kotlin