Tried to clean up some parts of decompiled code.