Refactoring code.

- Moving task logic into new ForgingManager class.