Dynamically generate code