full Debian compatibility, couple of refactorings