Use Spongy Castle instead of Bouncy Castle
Refactor code to make it prettier
Extract settings to separate class