normalizing code between client