Enforced coding style, removed dead code and added generic error popups when data cannot be inserted for presentation layer.