refacotor to extract Local interface
add mock for local