move code from poc code to here