Removed useless whitespace
Refactored to minimize callback hell