added some cosmetic attributes, cleaned some parts of the code