shift numpy code to own module