Global refactoring and prettify code ;)

all logic and behaviors are remains the same