security refactors