change module interface, add mock tests