refactored a little
refactored a lot