Add many log messages in metalizer. Move some code and delete some useless files.