code cleanup
added working Dial impl