Added Mac support and improved exetensibility or other OSes support