Moved everything to a directive