do some refactor. remove Atom type, use Expr type only
indent code