MOARRRR REFACTOR!