Removed bloat (useless/unused features) and refactored a bit