Revert "refaktorovana funkcia"

This reverts commit 95150a3a764a05abeadf412986e5b92ab0a7934a.
Revert "Revert "refaktorovana funkcia""

This reverts commit a7601b9e135213a7280ffca4837e49bc786c7050.
refaktorovane pre generating key