move maxadmin fuct into separate file