base logic setup