used multiple thread.

and used handler to generate files for more extendability