refact code module