Fix #87: security helper converted into component and improved

Fix #87: security helper improvement

Migrated from #4052
@klimov-paul You need use `===` in first and `==` only when you can't use `===`. This is simple rule. By following your logic you will never use `===` which is faster.