Finish to move all block to enum, and clean the code.