Little code refactoring

Hi, I have done some little code refactoring for compatibility with CsnAuthorization module.