alakazam: refactoring