refactor, add Ubuntu support