Change some code and optimize everything...

Signed-off-by: netcho <kkotlarski@abv.bg>