Removed some unnecessary code and added one directive, which helps to make ugly workarounds.