refactoring

considering creating a new object oriented macro generator