Refactor and GLink automation