Begin session
Refactor core and convert tabs to spaces