replaced all occurences of dirname(__FILE__) with __DIR__ to improve performance