add github link
Removed code duplication