Using strategy pattern has been improved.