port to debian, major refactor