Stripped unused code and upgraded style