Rafactor code little bit