[Stats] Separate layout creation logic
Add "FORM" column in database
[Stats] Remove code redundancy, add missing file