Big refactor of Golegd to be better organized