Added private methods to store encryption logic