avoided compiler warnings, improved code style