move observer and extend to lib dir