save code in model