fixed some inconsistencies and removed unused code