Learned simple factory design pattern.