basic init logic and tests