refactored for future MAL support