Major refactor #2