Cleaned Up Code , splitted into 2 different pulls

Cleaned Up Code , splitted into 2 different pulls