minor cleanup of codes in model