resructured interpreter to be neater