Refactoring Code and Adding License