Core1

Refactored the code.