refactoring, bugfixes and revoke fb access