made report submission code more modular