Some enhancement and psr-2 fixes