Cleaned up code
Revert "Cleaned up code"

This reverts commit e012db2fdaf44a02da4b8ae6e0a87adc78d3243c.
Revert "Revert "Cleaned up code""

This reverts commit 79d9333a27eeb8f749b8ae85aa76c2939d86b8aa.