Better structure, unit tests