getting a better design pattern