Improving desing of code using interface.