Add deleted code from refactoring