Fixing code style and removing unused fields