Minor tweaks
Big refactor