Refactored some code out so bring out multiple language support