Further refactored getmail