move learning state to it's own translation unit