Code refactoring. Size and title checking has been added.