kinda working typecheck-once approach