Optimize classes for web or api