Clean up code
Fix display: flex syntax for old Firefox and IE