Refactored to fit package structure and re structured classes and packages