Major refactor update, attempt 2.