Optimized code a bit, removed useless methods/fields