Refactoring + Adding go implementation