use flexbox instead of weird directive and fix some wrapping