refactored and made everything pretty