alakazam_spec: refactoring