Fix and refactor modals
Merge pull request #508 from AudriusButkevicius/modals

Fix and refactor modals