Removed uncessary whitespaces and replaced undefined with empty object