Removing Logging part for better performance.
Adding document size option.