small refactoring
implementing GCM