Complete refactor
Complete refactor