improve design pattern.