removed most system dependent code