Refactored a few little things