refactor, code cleaning

refactor according to best practise