move translator code to a seperate module