removes useless global var
adds multi deploy support
refactors tests structure to be more tidy