Removed some unnecessary casts and string appends