Refactoring: Changed entire script structure.