better avatar detector script and better branch extensabilty