refactaring
optimaize