Extract observer to the class
Added phpDoc