Fixed formatting/refactored