refactorization of functions & comments