Almost all code was lightly refactored