Refactored and started document check