try to use pure for better design