some refactoring + facebook client