import cleanup, some renaming, macro completion fix