Cleanup code and add macro steps