reconstruct code to use parser