Such JavaScript! Much refactoring! wow!