Remove workarounds and dead code