Security controller
Methods and tests. Test classes refactorgin.