move security related functions to tools related functions