Update macroid, some refactoring