abstract createball in separate function