Refactor code using session to reduce db operations, place device name layout on report