Normalize code to standart and add tests