Logging removal & better code layout