Starting refactor and commenting