Refactor, make neater