Added IoC.
Updated comments.