Got rid of code duplication, where needed.
Refactoring and minor tweaks.
Cleaned up redundant code.
Fixed few issues.
Dammit, I hate nameplates...