removed compilation warnings and some redundant code