Minor refactoring. Reduce implicit magic.