refine code; merge create_atm and atm_state into one atm command