remove dependendcy to external types and also define stack for cortex