Code cleanup, attemp to fix blocks