Simplified some parts of code

There were som unnecesary code