restructured into classes